﻿using ctolua.Models.Enum;

namespace ctolua.Models.UI.control
{
    public class MCChat : Mui
    {
        public override EUi type { get => EUi.聊天; set => base.type = EUi.聊天; }
        public MCChat()
        {
        }

        public MCChat(string id) : base(id)
        {
        }

        public MCChat(MCChat u) : base(u)
        {
        }

        /// <summary>
        /// 设置当前聊天框控件
        /// </summary>
        public void set_cur_chatbox()
        {
            game_api.set_cur_chatbox(this.role, this.id);
        }

        /// <summary>
        /// 设置聊天控件的频道为同盟或者所有人
        /// </summary>
        /// <param name="is_ally">是否为同盟</param>
        public void set_ui_comp_chat_channel(bool is_ally)
        {
            game_api.set_ui_comp_chat_channel(this.role, this.id, is_ally);
        }

        /// <summary>
        /// 显示/不显示玩家聊天
        /// </summary>
        /// <param name="chat_role">玩家</param>
        /// <param name="is_show">开关</param>
        /// <param name=""></param>
        public void set_player_chat_show(Role chat_role, bool? is_show)
        {
            game_api.set_player_chat_show(this.role, this.id, chat_role, is_show);
        }

        /// <summary>
        /// 清理聊天
        /// </summary>
        public void clear_player_chat_panel()
        {
            game_api.clear_player_chat_panel(this.role, this.id);
        }

        /// <summary>
        /// 发送聊天给玩家
        /// </summary>
        /// <param name="target_role">玩家</param>
        /// <param name="context">内容</param>
        public void send_chat_to_role(Role target_role, string context)
        {
            game_api.send_chat_to_role(this.role, this.id, target_role, context);
        }
    }
}
